/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package workers;

import entities.Categories;
import entities.Merchants;
import java.util.List;

/**
 *
 * @author bsmith
 */
public interface MerchantsWorker {

    // @PostConstruct but in here for testing
    public void startup();

    /**
     * Given the merchant text as on the bank statement, run it against the (Pattern) matcher fields on the Merchants object to see if it matches one.
     * @param merchantFromStatement
     * @return the Merchant whose matcher string matches merchantFromStatement or null if none match.
     * @throws Exception in the unlikely situation that ther is a match but the list of returned Merchants is empty
     */
    public Merchants lookupMerchant(String merchantFromStatement) throws Exception;

    public Merchants getNoMerchantMatchMerchant();

    public List<Categories> lookupCategoriesForMerchant(Merchants merchant);

    public Categories getNoCategoryCategory();

    /**
     * Create a new merchant from the given merchant string.  
     * @param merchants
     * @return new merchant so can insert into statement
     */
    public Merchants createNewMerchant(String merchants);
}
